
# 4：引入日志
import unittest
import HTMLTestRunnerNew
from common.public import project_path
from test_cases import register_case,login_case,recharge_case,withdraw_case,addLoan_case,bidLoan_case,repayment_case,invest_case,financelog_case

suite = unittest.TestSuite() #测试套件---收集/存储用例
loadder = unittest.TestLoader()
suite.addTests(loadder.loadTestsFromTestCase(register_case.interfaceUnittest))#通过测试模块来添加注册的用例
suite.addTests(loadder.loadTestsFromTestCase(login_case.interfaceUnittest))#通过测试模块来添加登录的用例
suite.addTests(loadder.loadTestsFromTestCase(recharge_case.interfaceUnittest))#通过测试模块来添加充值的用例
suite.addTests(loadder.loadTestsFromTestCase(withdraw_case.interfaceUnittest))#通过测试模块来添加提现的用例
suite.addTests(loadder.loadTestsFromTestCase(addLoan_case.interfaceUnittest))#通过测试模块来加标登录的用例
suite.addTests(loadder.loadTestsFromTestCase(bidLoan_case.interfaceUnittest))#通过测试模块来添加投标、竞标的用例
# suite.addTests(loadder.loadTestsFromTestCase(repayment_case.interfaceUnittest))#通过测试模块来添加回款的用例
# suite.addTests(loadder.loadTestsFromTestCase(invest_case.interfaceUnittest))#通过测试模块来添加投资记录的用例
# suite.addTests(loadder.loadTestsFromTestCase(financelog_case.interfaceUnittest))#通过测试模块来添加用户资金流水记录的用例
with open(project_path.report_path,"wb") as file:#将测试结果写入测试报告中
    runner = HTMLTestRunnerNew.HTMLTestRunner(stream=file,
                                              title="前程贷接口测试结果",
                                              verbosity=2,
                                              description="接口自动化测试报告",
                                              tester="一切、會恏"
                                              )
    runner.run(suite)





